package com.irdstudio.apicenter.console.service.authenticate;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.irdstudio.apicenter.console.dm.AppRoleRight;
import com.irdstudio.apicenter.console.dm.AppRoleRightDao;

@Service(value = "appRoleRightService")
public class AppRoleRightService {

	@Autowired
	private AppRoleRightDao appRoleRightDao;

	public int insertOne(AppRoleRight appRoleRight) throws SQLException,
			ClassNotFoundException {
		return appRoleRightDao.saveAppRoleRight(appRoleRight);
	}

	public AppRoleRight queryAppTradePrivate(String appId, String appRoleId,
			String menuId) throws SQLException {
		return appRoleRightDao.queryWithKeys(appId, appRoleId, menuId);
	}

	public int update(AppRoleRight appRoleRight) throws SQLException,
			ClassNotFoundException {
		return appRoleRightDao.update(appRoleRight);
	}
}
